Log api v4.1

Rebase of https://github.com/inliniac/suricata/pull/777

Merging this tomorrow unless there are major concerns. Further updates will be incremental. cc @decanio @regit @poona @ken-tilera @jasonish

There are some open issues, wrt to the setup code as pointed out by @regit. Also, I see room for some optimization wrt ip string creation and such.

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/156
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/76