Sum of squares methods for minimizing polynomial forms over spheres and hypersurfaces