Add support for arbitrary dict inputs to MWS calls

Also fixes a few PEP8 issues and some minor defects.