Frontend architecture refactor

some fixes for the frontend that make it nicer. Pulled out the functions in ```controllers/Dat.js```... those that connect with a remote dat into a new file ```models/remotedat.js```, and those who connect with our metadat backend with ```models/metadat.js```

Fixed some bugs

Use xhr instead of browser-request because its better.

Tests fail because there's a failing test unrelated to this PR. I wouldn't let this go through to merge normally but I'm the only one actively developing on this atm. i'm about to go deep dive into that test now and as long as that's the only test failing we are OK.