Major update to storage

Storage moved over to DBI meaning that any DBI database engine can now
be used. Logs, devices, variables are all stored in the DB now.

Variables updated to a config module which makes parsing cleaner and
easier