Got a lot more backend functionality working

Also added a testing.js file for testing the backend, without having to
run the entire webapp. That should probably move into test cases at some
point