Move vendor files to lib/vendor/

This PR cleans up the base lib/ folder a bit, and works towards #862.