Use Java timers to handle periodic tasks

Use a class-wide handler to implement runnables
Fix scoping for if-statement
Set initial wait time for timer tasks
Bug fix