Lots of stuff

Big js refactoring, using REST-ful endpoints now, other stuff