Added toArray() function
Bumped version number, wrote entry in HISTORY.md, generated distributables.
Merge branch 'release/0.3.1' into develop