adding callbacks as parameters for decodeFile. Added a sanity test for it.