Sorting fix and bound variable elimination expansion

BasicAtomComparator had higher matching cost items sorted as less than lower matching cost items. This has been reversed so that lower matching costs items are considered less than higher matching cost items in comparisons.

variableMap now stores a list of indexes where a variable exists rather than just catching one index. Using this, bound variable elimination has been expanded to eliminate all appearances of a bound variable in an atom sequence rather than just one.