Minor input refactor + polygon.js
Added vector2.js class