Began code restructuring

In other words, I took out all the functionality, ready to switch APIs!