Finished release v0.3.1.
Added some tests and bumped version number