Added function to handle orientation change

New exported function for handling orientation change. Call from the controller that loads your widget. See included comments for details