Process attributes from parent template before processing the child component.
Added Closure class and cleaned up a little