Feature/file assert

ready to go, ported from my private bit, added tests and is much cleaner.