Finish unfinished refactor
Write json and hash conversion functions for storage