Cleaning and Moving closer to google style guide

I started translating the JS code to python to use it in a sublime plugin. These commits are small refactorings and backports of features I introduced in the python code to move the generated code closer to the google style guide. Unlike the python code, there don't seem to be any unittests in the javascript code, so I could not amend them and starting from scratch there felt a bit too much. 

Introduced:
- property assignments should look like "property: value". The formatter now makes sure that there is exactly one space after ":"
- new option to always end with a newline