REST: allow functions as callbacks.

Simple fix for #352 issue and partly #389.

For #352 now you can write:

```Erlang
content_types_provided(Req, State) ->
  {[
    {{<<"application">>, <<"json">>, []}, fun some_lib:get_json/2}
  ], Req, State}.
```

For #389:
```Erlang
content_type_accepted(Req, State) ->
  {[
    {{<<"application">>, <<"json">>, []}, wrap(fun from_json/2)},
    {{<<"text">>, <<"html">>, []}, wrap(fun from_html/2)}
  ], Req, State}.

% Custom functions
wrap(DecodeFun) ->
    fun(Req,State) ->
        case DecodeFun(Req,State) of
            {true,Req2,State2} ->
                process_request(Req2,State);
            {false,Req2,State2} ->
               {false,Req2,State2} 
        end
    end.

process_request(Req,State) ->
    ...
```