fixed event total accounting and added tests

This actually needs to use the `update[@total]` syntax - it's referencing the key name for "total" which can be mapped to something else (e.g. "t')