Implement strong types for tup rem, fixes #59