REST API and persistence

WIP

Fix web tests
Merge pull request #7 from AlexWyrm/master

REST API and persistence.