reimplement EntityManager::get

use templates to prevent unnecessary casting by the caller