Numerous changes:
* Apply conventions
* Apply a failsafe to every while loop
* Fix some logic errors
* Use model point finding instead of ID's.