Removed add-global-function-entry and renamed index to index-ast
Renamed index to index-ast.
Removed incorrect function, and added comments.