For max comfort, how about this little day trip:
MIA-DFW AA908 (777)
DFW-LAX AA2421 (777)
LAX-DFW AA2426 (777)
overnight...then
DFW-JFK (any flight)
It's not as many miles as trying to connect through SJO but would certainly be much more relaxing in the first class suites compared to any narrow-body option.
Then again, Costa Rica is always a nice stopover if you have the time...