add instantiation_state class

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
use instantiation_state in required_to_instantiate

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
add check in instantiation_state constructor

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
remove unneeded code

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
update scope and required_to_instantiate behavior

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
added tests for instantiation_state

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>