Add caching to the "Project" class

- Cache results of matching file names against "gate_ignore" patterns.
- Cache profile “memberships”.