Skill and item usability testing for AIs

This allows AI-controlled units to determine whether an action can be
taken before attempting to perform it.