Moved EntityBase to a file of its own

EntityBase is moved to a file of its own.