Add FileTypeResolver and complete tests