Database speed improvements (factor 10)

Battle support in the editor started