Move RTC to Separate Module

* Move RTC code from main to a separate module.