[fix][33756] Fix autoloader. Fixes #3502

Added tests unit for loader

extract complicated check in a explicitely named function

removed unnecessary require_once in test

revert modification of bootstrap...