Tuned.
Numerous refinements and fixes.
There are still known bugs.
Added test app.