Move truncate_rules from fiptables to frules to ease testing.
Various code tidies.