huge restructuring: use roots to compile client

- removes a ton of code whose function can be replaced by roots
- separates out server and client
- organize utils