Close GH-154: Move syntax check functionality to an external lib file.