Added RTC, reorganized various files, fixed various bugs.