Make S3 generics. Closes #2