Ran fix js style and convert indents to spaces
Made calls synchronous
Updated tests
Removed some unecessary helper functions
More tests