Rewrite Finkelstein QB decomposer.

This implementation is smaller and faster but requires more tests. @IreneZR, please test it and merge.