Moving file related methos to another file

This will improve readability of the code.
It will also easy our life if we start to write tests
as that part won't depend on the vim module