Add definition for fileno
Rearrange headers

It's more logical this way.