Adapt frozen potential and wrapping to 2d / 3d handling

  It would be clearer if this were implemented in a separate function

    /** make vector V orthogonal to all the vectors in list_of_vectors */
    void orthogonalize_to_vectors(V, list_of_vectors)