added evaluation of functions in kompile for the java backend; fixed some sorting bugs