Reduce header dependencies
Cosmetics

Placed 'extern' functions together.
Marked local functions as 'static'.
And some minor clean-ups and cosmetics.
Use 'override' keyword
A bit more sane hooks declaration