Optimise file extension comparison.
Optimise WAD searching.
Fix compiler warnings.
Optimize string tokenization.
Reduce string copies.
Tidy up IO code.