Refactor make_vector into libfoo and add a test