Implement lookup, more builtins

Move lookup to templates, not views!