Pass Functions rather than SEXPs to C++ for link and logLik