remove singletons, introduce main JavaDB class, smaller changes for multithreading. Not fully multithreaded version yet.