Rewrite class menu code (closes #170)