Add support for more OpenFileFlags and refactor 'openFd' (PR #59)