Cleaned up code base, addressed TODOs.

Hard-coding of streams and config variables removed.
Exceptions handled more appropriately.
Imports optimized.
Updated Javadoc and removed unneccesary comments.