Fixes #6
Fixes #7

Working replay. Still performance is not good, mapping has to be
properly designed, and queries optimized.