I got the Save Manager app working (with TubeHax) and checked the ghost data in a hex editor. The way the game stores inputs is very similar to MKW. The data is in pairs where the first number is the button being pressed and the second number is the number of frames that it's held.
There are 2 sections, one for button data and the other for directional input. MKW had a 3rd section for wheelies/tricks. Input data starts at offset C4 and the bytes from C0-C3 tell how big each section is.
Section 1 - Buttons
00 = No button held
08 = A
28 = AR
18 = AL
38 = ARL
There are more but I haven't checked them yet, these are the main ones for TTs.
Example: 08 20, 28 12, 08 A5 = hold A for 32 frames, hold A+R for 18 frames, hold A for 165 frames
Section 2 - Directions
1st digit: Left & Right
0 = Full Left, 7 = Neutral, E = Full Right
2nd digit: Up & Down
0 = Full Down , 7 = Neutral, E = Full Up
77 = neutral
E7 = right
07 = left
7E = up
70 = down
There are combinations for diagonal inputs, example:
8C = slightly right, mostly up
CA = mostly right, somewhat up
19 = almost full left, slightly up
Example:
77 80, B7 01, E7 21 = neutral for 128 frames, halfway right for 1 frame, full right for 33 frames.
As for the other data in the ghost, I couldn't find where/how the time is stored. I don't see the lap splits either. The Mii Data is there and I assume the kart combination data as well.
Here's what I got for the track list. To get this I sorted each ghost by the number of frames in the input data then compared that to my sorted timesheet.
Code:replay00.dat - Mario Circuit
replay01.dat - Rock Rock Mountain
replay02.dat - Cheep Cheep Lagoon
replay03.dat - Daisy Hills
replay04.dat - Toad Circuit
replay05.dat - Shy Guy Bazaar
replay06.dat - Neo Bowser City
replay07.dat - DK Jungle
replay08.dat - Wuhu Loop
replay09.dat - Maka Wuhu
replay10.dat - Rosalina's Ice World
replay11.dat - Bowser's Castle
replay12.dat - Piranha Plant Slide
replay13.dat - Rainbow Road
replay14.dat - Wario Shipyard
replay15.dat - Music Park
replay16.dat - Retro Coconut Mall
replay17.dat - Retro Koopa Cape
replay18.dat - Retro Maple Treeway
replay19.dat - Retro Mushroom Gorge
replay20.dat - Retro Luigi's Mansion
replay21.dat - Retro Airship Fortress
replay22.dat - Retro DK Pass
replay23.dat - Retro Waluigi Pinball
replay24.dat - Retro Dino Dino Jungle
replay25.dat - Retro Daisy Cruiser
replay26.dat - Retro Luigi Raceway
replay27.dat - Retro Kalimari Desert
replay28.dat - Retro Koopa Troopa Beach
replay29.dat - Retro Bowser Castle 1
replay30.dat - Retro Mario Circuit 2
replay31.dat - Retro Rainbow Road