Decode api update v1.1

Here's an updated PR. First patch is unchanged but second patch uses an other approach as the one used before.

PR build: https://buildbot.suricata-ids.org/builders/regit/builds/57

Ticket: https://redmine.openinfosecfoundation.org/issues/746