added new functions for building gram basis (from Frank)
caching of results and new newt. polytope code