Add ship cache, rearrange loading code a bit
Big rebuild of stage detection algorithm

Should work a lot better now, and be dramatically friendlier on
resources to boot.

Still won't properly load ships that rely on parts breaking off
due to stress (e.g. #125995).  Could possibly be improved by
looking at engine stages, or possibly count engine nozzle->tank
connection as a detach point.  Or just let the user adjust part
stages.
Fix stage sorting algorithm on JS side