Port of Brooke Anderson and Roger Peng's weathermetrics package to Lua