Closures and function parameters fixes

This pull request clarifies and fixes how function parameters and closure captures are being dealt with. They are now proper constant references.

This also introduces clarifications in compilation error messages.