Allow register to be used as a class decorator (#322)

This patch allows `register` to be used as a class decorator, with or without extra arguments, following up on #322.  I've included tests and documentation.