Function to set up an inherited class that calls its ancestor constructors automatically. Can also be attached to constructors.