Ignore GNU Global files
Count rules and calculate probabilities

Also fixes `simplify_tree` to correctly remove empty subtrees.