Move size logic into its own function...

I moved the size logic into the setSize function. setSize is then called
by render(). I also included the code to properly detect a change event,
as referenced by issue #85 and pull request #76.
Merge pull request #97 from caseyjhol/master

Move size logic into its own function and fix #85 and #76 (change event)