Implement a proper first pass of not rewriting the source str
Completely and utterly refactor environment detection

Mostly, switch to using native utarray methods. The existing stack
functions (stackT) could not grow dynamically.