Moodle 2 tidy up

Hi guys - nice to see some updates to the ILP block - We have a client hoping to use this in 2.5  - I had a chat with James about this last year so it's nice to see it getting updated - we've had a lot of custom changes which I've ported based on your new code - would be great if you could take a look and merge - I bounced an E-mail to ULCC separately as well.

Some of these patches are old and are based on some of the reports in the Moodle tracker.

We also have a new report that I need to port for our client but I'll submit that separately as you may not want to include it in the core version. - feel free to drop me an e-mail if you have questions - thanks!