core: Add a simplifications function

The simplifications function does pretty much the same as simplify, but
it returns not only the last expression, but all of them.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>