Refactor and initial testing of setup_db

### Changelog
* Cleanup of `node/setup_db.py`.
* Some schema abstraction.
* Simple tests.
Not failing or raising some kind of exception. They should be fleshed out in the future.