Second version, ne nested class, no comments

Nested class eliminated, added a few more tests. No comments yet.