Move view functions into views namespace.