Frontend architecture refactr

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 nicer.