fix bug in gate_expand_3toN for the case when N=3 and targets and controls are only permuted
added unit tests for testing permuting controls and target of 3-qubit gates
Merge pull request #211 from jrjohansson/bugfix-gate_expand_3toN

fix bug in gate_expand_3toN