Add backcompat for Template.__define__

See #2480