Update command-line tests

Reintegrate a couple "debug" method back into the main library
Close over uses of Function.prototype.apply to avoid subversion