Run layoutIfNeeded before renderInContext

Things like auto layout seem to work best if you call layoutIfNeeded before renderInContext.
Merge pull request #5 from pat2man/patch-1

Run layoutIfNeeded before renderInContext