General code cleanup and documentation added.
Divided code into modules.
Fixed a minor bug where an error was being printed to the console if the points were being drawn of the image.