Allow mock overriding with functions

Not very pretty.