Port to 1.2 variable syntax and real roles, minor best-practice updates