Optimize all EntityId::unserialize

This is related to #219.

The only thing I'm not sure about is that I dropped the is_string check for the type. Is this ok? I think so. A check for allowed types was never done anyway.
Uh, is it ok to remove this and have a default (public) constructor? Or add an empty private constructor instead?