Add preferences controller and create preferences window UI