Code Structure Changes and FRAM functions

added FRAM read/write
resorted functions/variables into different files