Changed to class structure

Kind of. Just JSON structures right now, actual classes seem
unnecessary for the moment. I tried implementing them, but ran into
several problems along the way.
Keeping this file until node-webkit is re-added