added messages to import errors and implemented declare/checkDeclared functions