Added new tests and bugfixes

Also replaced buggy OTAssetContract::formatLongAmount with
a much simpler and clearer version by using streams.