chmgen: Fix JS paths, work around mainPage JS bug, compilation fixes
Merge pull request #241 from CyberShadow/chmgen-2013.01.27

A few chmgen fixes