added background thread, wiringPI, tvservice workaround and alarm
database access