Added functors for registering functions. Need some cleanup but will hopefully make life easier later.