Add better forward reference handling
Create forward declarations for implicit forward references too