Added some locking functions
Work on locking and added structure for status tracking NO TESTING YET!
Tested without the SD card and fixed a few bugs
Tested locking code