A bunch of cleanup and other fixes, also adding support for multiple currencies to be traded at once.