add cglobal and cfunction to manual (ref #3094)
add more clarification about writing code inside functions, as a
matter of style and performance