added clearer error when database server isn't up
extensive refactoring of the ClojureScript code