Development release 0.4.0.

Changes:
- whole vectors are now dynamically allocated and a teardown function is
provided