Tidying up the scheduler.
Refactoring RIPerm class.