Move hardware initialisation into "init.h" to keep things tidy.

It was a bit long and specialised, and required some odd includes. Splitting it out makes things nicer.