implement entity system

+ return int instead of entity_kind_t in entity_kind()

See #9, and also #4 because yaay, TDD.