fixes #42
fixes #37
Refactoring, reformatting to comply with jsHint / jsLint. Fixed several bugs while doing this. Ignoring scripts that are added on InstaSynch now.