Working on writing master keycard data to the flash memory.  I'm going to try it at instruction 0x005300, which should be out of range of the erase_database function (which should erase from 0x005000 to 0x005200), while still giving us enough room to store the card's data.  Also threw pin I/O setup and external interrupt setup into their own functions.