Refactor khameleon in preparation to moving to v2 with richfaces