LAM.mpoly improvement and clean. Differs slightly from previous version and is not backward compatible.