Ported first bits of code to baremetal avr

**Please don't merge this yet**

Opening this now and will add commits as I get this up and running. This PR is here for questions/feature requests/comments/general whinging.