Major refactor of client side (mostly JS) to match proposed style