Cleaned up ResourceMAP agent hierarchy, fixed a state transisiton bug..