Dev log api v1.13

Changes since https://github.com/inliniac/suricata/pull/754:
- rebase
- merged some commits separately through https://github.com/inliniac/suricata/pull/765

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/129
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/49