Use -callback specs instead of behavior_info

As of Erlang 15B a new callback spec was added which allows callbacks to
be precisely defined as well as work with dialyzer.
Update edoc for decode callback

Add optional security namespace to decode callback edoc and update
encode spec.