Cleaned up the code a bit and made everything physfs compatable