Removed magic 4s in for loop so non-square shapes will work.
Apparently I don't have to specify array length after initialization in JavaScript. Useful to know.
Changed an erroneous reference to square when I meant shape.
Moved numPoints into the shape constructor. I thought that made more sense.
Reordered things a bit.w