change the way to load prototypes (more flexible regarding circular definitions)
put global functions in a separate file