Corrected documentation.
Consistent copyright in headers.
Add TypeScript declarations for API.