- Add stats collection and output to layer example (fixes #40)