Take Formats bigDecimal setting into account when parsing.

Also removed some redundancy in tests.