Fixes a bug from the 4.0 branch, also changes it to be less queries.
Fixed getSetting usage in __destruct calls.
Added proper prefix checking when looking for a unique file name.
Made $admin, $bigtree, and $cms available in parsers.