Made formatting strings compatible with python 2.6

Also fixed styling according to pep8
Change log for #316 and code style tweaks.