AST: Added used member to Function and Object.

Functions and objects which are both undefined and unused will no longer generate unnecessary IR declarations.