Add apexq scripts from d2-common

Depends on http://review.cyanogenmod.org/#/c/45074/