Rewrite of the consolidation rules

Signed-off-by: Tom Haynes <loghyr@primarydata.com>