Rewrote metrics stuff.  Fixes #139.
Added new metrics portlet.