added testing for user, and added subgoal and metagoal self-referencing