torch.type

This PR adds the new utility function `torch.type(obj)`, which is similar to `torch.typename(obj)`, except it defaults to Lua's `type(obj)` when `torch.typename(obj)` returns `nil`. 

Its convenient, unit tested and documented.