Temp commit to try and merge

Major re-org of javascript, but not completely working.