cleaned database.py up slightly
finished up the entire class, can improve functionality and clean up some methods later, there is room for improvement, also final documentation near the end
added a test for the system.  Its slow for the current database