fix rotation/placement of entities.  Add gate rule.  Need to update to
use a name instead of int id for gates for forwards compatibility.