Yorkshire shrugged off the absence of Imam-ul-Haq to take the upper hand against Surrey, while Leicestershire took a step towards promotion.