Add CoreMotion API and fix alloy2jsca script