Properly encode IMPLICIT tag

Add tests for IMPLICIT and EXPLICIT tags with submodel and fix broken code.
If use is present, implicit tag would be handled inside submodel. Should be covered in tests.