Make more use of DefineConsoleMethod

Resubmission of #887 with some fixes.
Currently, `isObject(0)` returns `false`, so I guess this is technically valid. TS cannot differentiate between `U32` and `S32` because of string typing (IIRC), so everything is stored as `S32`, which is why we end up truncating `SimObjectId`, which is a `U32`, to an `S32` whenever we pass it to scripts, and using `-1` as an invalid value. I do imagine there'll be code out there that explicitly checks for `-1` return values, so let's stick with that for now.