notebooks: add db store and get/create functions
Created by: novoselrok
This PR adds the notebooks DB store and get/create functions with tests. It also adds validation functions for blocks. Since blocks are stored as JSON we have to ensure (best effort) their validity before storing them in the DB.
The rest of the store functions will be added in a separate PR.