refactor holSyntax pulling out common definitions

i.e., those shared between stateful/stateless.
plus some minor cleanups/improvements.