Implementing Higher-Order Term-Rewriting for Program Transformation in lambdaProlog