Added preliminary support for price tracking and histories. Fixed a few
other bugs in the core.