Updated with feedback from @tycoish
how to "atomically" track max_value when pushing to an array
based on http://stackoverflow.com/questions/8508663/calculate-max-value-in-an-atomic-findandmodify-operation/8509324#8509324
edits to dcrosta: track max value in array pattern
Merge pull request #1 from tychoish/tychoish
edits as previously discused.
made a few more clarifying changes