A better JavaScript typeof function