Small fixes

Fixed .gitignore
Fixed excluded directories for jscs
More codestyle and some logic fixes for history.js