Initial merge of apexq code