Replaced tree and all arrays with database code
Implemented and tested SQLite database interface