Refactored database class

Added arrayToString methods, tests for database