Add liquid 2.5.2 compatibility, make performance fixes.