2D Vector class with functions. Written for JavaScript.