Improved NPN handling, minor fixes
Minor bug fixes and improvements
Further client API development

Fixes #1