added code format/style test and fixed up code

I converted all instances of `'''` to `"""` because PEP267 uses the double-quotes.

I also moved the param types into the `:param <type> <name>:` format.

Fix PEP8 things in a few places.
I don't understand what you're suggesting, but I'm open to changing this in anyway as long as the code is style checked.