modular build code optimization + some extras

Decided to go trough the whole code bit by bit to make sure everything works as intended for the release.
This will hopefully be last update till release.

Changes: functions will now properly exit early without doing any unnecessary work if previous function failed checks or w/e.
Snap building now has full support for water bases too far away from coast (nearestObjects seems to be limited to ATL)
Args should now be properly passed to all callers.