Added operator== for types (and other useful methods). Fixes #16.