Initial commit of Scheduler.
Add unit tests.

Uses rewire for mocking private module members.
Add retrieveState API for debugging.
Merge branch 'scheduler'
Extra scheduler commits that went missing.
Conflicts:
	package.json
Merge pull request #12 from xirzec/master

Merge in prototype Scheduler