Added area manager that keep groups of same type

This took much longer than it should have... was trying to remove blocks
and rebuild as I go, but really don't know javascript well enough