Removed dead code
Updated docs
DId some cleanup. Added proper exceptions
Some extra cleanup.