Shameless port of RubyMoney (https://github.com/RubyMoney/money)