Added meaningful exception types. Cleaned imports and exports. Tweaked
linesep code into working. Muted a pylint warning.