Closed #113
Fixed various bugs
Lot of refactoring done
Added javadoc
Removed unused classes