General tidying and clarified when plugin init runs.
Improved plugin loading routine.
A number of tweaks to core code.
Some improvements to functions.