- Added threading to application
- refactoring code

Signed-off-by: Daniel Dahlkvist (dice) <daniel.dahlkvist@dice.se>