refactor into app/server, add tests
minor revisions and a new readme