Add opt -> ref transformations
Fix stats. Add console and JMX reporting