Add a utils file to store common operations like map() and encodeParams(). Modify MatrixClient and MatrixHttpApi to accepts opts as constructors.