Fix build break.
Move syntax method to a function.
Move JSON related helpers to test library.
Move syntax method to function.