Feature/refine class definitions

I changed a couple of thins in the way the code was being implemented as well as adding unit tests for each class definition. I think with this we will be able to make modifications with more confidence. I didn't change the API though at this point.