Adding filetype detection, fixing docs