Bunch of js updates, possibly slightly functional now