Cleaned up code

Moved all functions that were using CheckTime to main.js, so they would
be executed at once.