started adding tests

Enough API design, prototyping, started to write tests.