Improve handling of core definitions so that they can be inlined in top-level expressions
Improve benchmark script to compute averages of multiple runs