bugfix in source maps code and some cleanup

Fixed error when compiler ends up with error and source map generation
crashes whole process. Also did some code cleanup for better docs.
Merge pull request #11 from isnotgood/master

bugfix in source maps code and some cleanup