Update vector.h

 - Fix lots of templating issues
 - Correct some return/argument types
 - Inline ALL THE THINGS