Working copy with tests
Merged.