bibsdb.js refactored into more files and removed