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

i commented a bunch inline
ahh yea that makes sense. when I switched over the code to the composition style I found it to be more straightforward to have `api/index.js` have the auth instance and the router instance in it, and  it would pass those instances into the sub-components. I think we should worry about further refactoring when we add more routes/providers than fit comfortably in one file (basically cross that bridge when we come to it)