add toPath and toLinesArray methods, issue #78