Adding a couple unit tests for the project-level session, and fixing potential NPE when an extension is declared that already exists in the core distribution.