Normally in `UnitAI.js` formations try to check the range (and move) in the same way as normal entities, which leads to weird function calls (`target` where `type` is expected) this patch creates extra functions to seperate the calls and behave more logical. Partly discussed in D1971.
The seperation may also facilitate other formation-related diffs.