Some cleanup. Also add support for variable template names in List tags.