adds several javascript functions for vector math with tests