Move _stat replacement to the beginning of the file (close gh-43).
Fix incorrect preprocessing order.
Add tests for CRT functions (close gh-13).