Initial work on JS rewrite
Majority of the menu functinality
Partially implemented layer manage