Fix a few various typecasting bugs.
Refactor stat functions to look more like Go's original. Also allows for access to fields we can access from SFTP but do not conform to os.FileInfo.