[wip] lua output v21.3

Merges https://github.com/inliniac/suricata/pull/994 and https://github.com/inliniac/suricata/pull/976, rebased.