Bump version to 0.3.1
Add tests for __len__ and __iter__