Added tests. Fixed few minor issues found while writing tests.

Added tests. Fixed few minor issues found while writing tests.
Fixes #5 
I think it's fine, if you write those classes by yourself.  But here we propose other users of our lib to know about protected/private attrs making them as a part of interface to extend our classes.  I'm not sure if it's fine or not, but it's a bit unusual for me.