Fixes gh-171. typeof null should be "object", not "null"

This also revealed the bug reported at https://github.com/espruino/Espruino/issues/172

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>