Rework build infrastructure.

I've copied the build infrastructure and file organization from:
  https://github.com/mblythe86/stm32f3-discovery-basic-template
and blithely hacked away until things build. I don't actually have an
stm32f4 discovery board to test on, but I have verified that I can build and
program an stm32f407.