Re-write to measure dynamic_cast cost

Complete re-write using knowledge of how dynamic_cast is implement
Up to date module