restructure code a bit to make more modular, add missing deps, add npm s...

i commented a bunch inline
boom, yea this makes sense