Adding Entity-extension to work with files, fixed some minor bugs in Entities