Added outline drawing support

Major code cleanup as well.