A JavaScript 2D vector class with methods for common vector operations