Refactored Core Functions into a Class and Methods

Moved Scheduler code and Class code into subfolders. Created class code
and moved functions into methods. Created class_test to test class code
and to serve as example.