AST: Added temporary register generator to Function.

It is based on a generalized number allocator template in Core, and has been used to implement pointer dereference.
Also slightly changed how AST::Functions generate IR::Functions.