Line drawing done.

All that is left to do is extensive commenting and code cleanup.