Added settings boilerplate code, moved some code to onDreamingStarted.