Optimize class hierarchy check method.
Add tests for util method.
Move controller action lookup routines and info to a separate class.