Updated to work with a few more file types and a few more options

Still rough, not applicable to all situations or inputs.