api/msgpack-rpc: Add Function API type

This new type has one purpose: Abstract the knowledge of msgpack-rpc or channels
out of the API as much as possible. Passing messages to channels will be the
responsibility of the msgpack-rpc layer.
provider: Refactor to use function type