trace and logdet now has a MMFunc type derivative which can be used for next level computing of derivative