refactored ProjectState (listeners and metadata service) and tests