Moved scheduler out of plugin, added better testing