Dynamic addition of tables

- device.cpp should be good to go, but is not yet tested
- fixed up CreateDB and CreateTestDB
- started changing over the site to work with the new table names. Past
time to finish that!