Adding custom constructor example code.

In response to #2332 and several other tickets that have come up, I think it would be helpful to include an example of a custom constructor in the docs - several people have mentioned that they weren't aware that this was possible.