Major refactoring of the code

Split into file per table, with Create, Retrieve, Update and Delete
(CRUD) for each table. Also created separate test file for each tables
unit tests (more work to do on those).