Added invalidSignalException to handle incorrect length assignment. Also added code and tests for generating entity ids in a hierarchical manner