Misc cleanup

- use the Lua aux library
    - optional argument checks
    - more detailed error messages
- restrict the width of the dygraph counter div