Develop mechanism to cache intervals localy

Several changes are required in the way intervals are handled:

- [ ] Need to decouple (HTTP) submission logic from interval generation and temporary storage
- [ ] JSON ~~serialization~~/deserialization for Intervals
- [ ] Select a storage mechanism and make it work. 
  - At the moment, we are experimenting with LevelDB 

Created this pull request early to allow for inspecting the changes and commenting early on.