Refactor: Clean up dataAccess.js

Move (most) function definitions out of the return
statement, clean up the callbacks with if-else
all around.