Major refactoring to YAQL-based syntax