File format implementation + threading tweaks