Move some checkout utility functions into a shared file and fix some crlf filtering issues when verifying file contents.