Parameterize the "velocity"

Not really a velocity because it's not a vector ... yet.
Move arena in prep for more movement "modules"
WIP: add flocking

Adding a new movement to the pipeline to handle flocking behaviours: the
flocking movement will figure out where the boid wants to go for
flocking (using an average of ... uh, actually repelling each other) and
then combine that (up to the max "velocity") with the arena movement.

I just realized that I'm not attracting boids to each other, only
repelling them away from each other. I'll need to add the attraction as
well.

fun.js is for common functional tools: map, reduce, foldl, etc.

Next up is to write tests to make sure this does what I think it will.

I also moved flock and arena into their own "movement" directory to keep
things organized. I'd like to be able to have many movement "modules"
working together.
Tests: map, distance; fix arena test getTests

arena_tests.js had simply "getTests()" but I need each different test
file to have it's own getFooTests() function.
Moved distance to geometry.js
Fix & Test reduce()
Test flock functions: sum, getX, getY
Fix & Test aggregatedAdjustments
Fix & Test adjustToNeighbour

I need to write tests for pushing the boid in each of the four quadrant
directions to make sure all the +/- work out.
Test pushing a boid towards Q2

i.e. if the neighbour is below and to the left and is only %50 of the
required range away from the boid, then the boid needs to go 100% of the
distance between them up and to the right, i.e. (x1 - x2), (y1 - y2)
Test adjustToNeighbour pushing towards Q2 & Q4
Cleanup
Removed velocity from adjustToNeighbour & Test

I don't want to account for velocity too soon because then most
adjustments will end up being the same; if I wait until I have all the
the adjustments from the neighbours then some will outweigh others and
then I can chop the winner off at the velocity.

e.g. adjustment 1 pushes 4 left, adjustment 2 pushes 2 right; if I chop
them both down to velocity 2 then they're even; if I add them up then
I'll still be pushing 2 to the left.
Test findNeighboursInRange & fix location field

I confused boid.location with boid.point in a lot of cases;
I should probably create a boid "constructor"
WIP: fix tests while working on flockVector

Since I moved the velocity cap to aggregatedAdjustments, rather than
capping each individual adjustment (and unfairly weighting them) I had
to find out by what proportion the aggregated adjustment went over the
distance, and then subtract that proportion from X & Y;

e.g. if the velocity is 10 and the adjustment is 20 away from the boid's
point, then the adjustment has to be cut in half, so the X adjustment
and Y adjustment are both cut in half.
Test flockVector

For posterity, here's the calculation for adjusting:

- take the x,y and calculate the distance of the neighbour from the boid
- figure out how much more space we need from the boid
- figure out what percentage of the distance we are away we need
  to add in the other direction:
  e.g. if we're 1 away and the range is 5, we need to move 400%
       of the distance in the opposite direction
  e.g. if we're 4 away and the range is 5, we need to move %25
       of the distance away
- subtract the neighbour x & y from the boid's x & y
  e.g. if boid is at 0,0 and neighbour is at 2,3, then 100% of the
       distance in the opposition direction puts us at -2,-3
- use the "% of distance in opposite direction" to calculate how
  much of the opposite distance we need;
  e.g. if we need to go 400% of the distance in the opposite direction
       and 100% of the distance in the opposite direction is -2,-3 then
       we need to go -8,-12
       (This makes sense if we consider that a 400% required distance
        means we were 80% closer than we should have been)
- return the opposite x,y each multiplied by the distance% required

Phew.
Cleanup
Cleanup
Broke down and added some logging on the page
Fix animate: forgot I'd added the velocity param.

Duh.

The animation is still broke.