add optional head parameter to top-level page functions

This PR is branched off another PR (https://github.com/rstudio/shiny/pull/315) so requires that it be taken first.