Modified all files to use application level variable for database; app pretty much works; need to speed up by adding indicies