Ported to JS

Fixed issues with Alias, Entry. Mostly clean sheet rewrite of generator
(it was mostly unconverted PHP anyway)
fixed new line issue
removed errant consoles, debugging
new line fixes
Merge pull request #18 from stockholmux/js

Ported to JS. [closes #17]