Refactored data.js into separate client and server files
I can haz unittests!