Fix timing of rerender event in GC nodes

Move the triggering of the rerender event into an overridable method
'afterRender'. Some nodes don't have the correct dimensions
immediately after rendering their DOM elements as they may need
to wait for images to load, or for a script to run (e.g. MathJax)

Change-Id: If204f665dcb2fd69d00a183279056d11188ddd74
Merge "Fix timing of rerender event in GC nodes"