Updates to drawing/editing

- improved algorithm for selecting lines
- new coordinate mapping classes to support different mapping methods