ENH Add magic number based format autodetection