Adds const specifier to isSmallInteger and TObject::cast<T>()

Issue: #27