Methods for Janet bases and Pommaret bases in Macaulay 2