First draft of persisting states on a DB

- the code is currently in test scope because it requires spring-jdbc and h2