Improved the re-usability of LinePath

LinePath now takes an `Array<T>` instead of T[], which should improve the possibilities to avoid GC.

I also made the `createPath` method public so one can re-create the path based on new waypoints without having to create a whole new `LinePath`.