F2/F4 Flash cleanup

Moved flash code to common area as it is shared between F2 and F4.

Tweaked the flash_sector_erase function to take a numerical sector number rather than having to pass in an obscure value defined in the header.

Added higher level flash writing function.