Add test cases and fix bugs

- Replace lastAccessTime with lastRunTime and update it after task execution for accurate quiet period check
- Do not add an unnecessary wakeup task in execute()