Changed Id to Int32

Also only raise events if RaiseEvents is true
Added EntityEnvironment
Implements Entity