Added stats and summary functions for trace

Added `stats` function to calculate posterior statistics and `summary` function to pretty-print them.