Add diff() function in vector.js and test