Improved API generation.

- "Project name" and "opened level" determined by inspecting primary project namespace.
- Fixed bug where re-use of Sami cache directory caused other project's APIs to be mixed in with desired project.