Add support for file stat objects

closes #1