Condense and organize core loop

* Lots of DRYing
* polyline support for Entities
* Add icon and createInfoWindow support to filter functions