Added end-to-end test for offline synchronization

- Uses phantomjs to make sure we don't break synchronization
- Tests "fresh" synchronization as well as
- Synchronziation against a local db created with a previous version