stub()/stubs() should not fail if passed null/undefined

* Basically, if passed null or undefined, return it; otherwise,
  modelize/stubify.
Merge pull request #1726 from reciprocity/feature/fix-script-error-on-stub

stub()/stubs() should not fail if passed null/undefined