Optimized tryCast, added DefaultEntityController

Signed-off-by: bergerkiller <bergerkiller@gmail.com>