Added unit tests and separated the file loader into another file