Add invariant to check getInitialState return value. Fixes #397

This adds an invariant that checks if getInitialState returns an object. Let me know if I should change the error message to something different.