Add support for LWPOLYLINE entities and refactor related code.  Fixes #1