Rewrite of the explode routine for speed

What was taking minutes (ReDimming every loop is insanely slow) now
takes <30ms thanks to some extreme optimising.