Allow setting a custom document class

This will be useful if one wants to subclass the default document class.