app layer rewrite

You can watch build progress at https://buildbot.suricata-ids.org/builders/poona/builds/31
You can watch build progress at https://buildbot.suricata-ids.org/builders/poona-pcap/builds/3

bug #978.

More details on what the PR does, can be obtained from the commit messages.

The pcap build has one failure, and this is because ssh is disabled.  When we fix the ssh parser, this should be fixed as well.