Simplified postMessage, removed unneeded code

Simplified the postMessage call based on Jamie's gist (https://gist.github.com/jameymcelveen/6793503), removed unneeded code and added an option to force a resize.