A versatile CQRS and event sourcing framework