Added support for testing. Started to write scheduler tests.