Implemented challenges system.

Still needs some fixing up, I'm getting to that...