Added non-reference based vector library, and some more units test.
Run valgrind on the state tests for travis-ci.