restructure everything
fix up some weird things with js and docs