Added polyline encoding logic and encoding route functionality (lua is not complete).