EEPROM code fully tested and working

Contains some minor fixes