Created common functions for typeof

As I mentioned in #251 I'd been thinking about some refactoring of the type functions, and a little code golf.
This PR moves most of the type checking to separate functions, and pulls out the "[object Object]" and "[object Array]" constants.

Code size savings (not sure why the compression isn't as good):

File | Before | After | Savings
----- | ----------- | -------- | -------
mithril.js | 33028 |  32811 | 217
mithril.min.js | 14515 | 14230 | 285
mithril.min.js + xz | 5712 | 5708 | 4
mithril.min.js + gzip | 5813  | 5821 | -8
mithril.min.js + zip | 5939 | 5947|-8
mithril.min.js + bzip | 5716 | 5730 |-14

That is such an obscure find - I like it.

You should make a test for it too.