Add simple persistence

This will not work due to threading issues
Add documentation to functions
Renamed device_connected to is_device_connected
Minor changes to file
Add Flask app
Function cannot be static
Fix database in multiple threads problem
Add SQLAlchemy for persistence

Remove sql statements