Added core functionality. Mostly working.

Still have a few bugs to fix in Scheduler.