Fix TentType: Handle type uri in fragment, Decode uri encoded fragment, add #to_uri method to output URI with encoded fragment