More rule builder stuff, adding template modal