Re-instate test tool archetype icon update during compile.
Improve speed of some index related operations, particularly archetype ref matching.
Refactor flattener into 3 shared objects - specialised archetype flattener, rm_flattener, template overlayer.