First correct version of quadtree. More to practice javascript than anything else...