A simple 2D JavaScript flood fill.