Allow for class-based decorator. Closes #157