Fix a misplaced const.

Reported by clang.
Some cleanups + minor optimisations.
Add more const.
More cleanups.
Extract a variable.
Add another const.
Convert fc_solve_card_compare to accept cards.

Instead of pointers - chasing pointers is costly.
More consting.
More consting.
More cleanups/refactoring/optimisations.
Reformatted.
More cleanups.
More cleanups.