Optimizes maploading again, saving 0.4 seconds on a bare init. Supports loading dmm again (#71074)
Optimizes maploading again, saving 0.4 seconds on a bare init. Supports loading dmm again (#71074)

## About The Pull Request

When I optimized maploading in (#69632
d34fa4c642839215df5ba985d098a04e4d555b5b) I made some assumptions based
on the TGM format, so how newlines worked and such.

This would break attempts to load maps in the dmm format, so maps edited
in dreammaker and not commited yet.

I've fixed this by adding a map format detection system This has allowed
me to further optimize tgm by taking advantage of a list of assumptions.
I printed them out in a comment near the top of the file.

This showed the most in build_cache, which went from 0.7 seconds to 0.4
on my machine.
The optimizations here involve using regex to pull out var edits,
parsing models line by line rather then all at once, which allows for
much cheaper parsing, and avoiding a safety trim()

I did also save like 0.05 seconds in load, because I could pull a bunch
of operations out to once per map, because of prior knowledge of where
the max/min x and y's would be.

## Why It's Good For The Game

Speed. Also ensures mappers don't get fucked over.

Co-authored-by: Mothblocks <c52edec2bd3a27a0b2b5cccb4d09c5385b416d7e@users.noreply.github.com>
Bawhoppen/-tg-station,Bawhoppen/-tg-station,tgstation/tgstation,Bawhoppen/-tg-station,tgstation/tgstation,Bawhoppen/-tg-station,Bawhoppen/-tg-station,tgstation/tgstation,tgstation/tgstation,Bawhoppen/-tg-station,tgstation/tgstation,Bawhoppen/-tg-station,tgstation/tgstation,tgstation/tgstation,Bawhoppen/-tg-station,tgstation/tgstation