Large rewrite.

Simplified code & public API.
Removed identifier API.