Refactored code and added initial binary file reader/writer