Set up head properly, with a few lines from PhoneGap sample app.