Allow handlers as constructor functions.