Changed implementation of type_id<T>() with a simpler and faster alternative