Made changes to gates.py file to add a parent class for multiple input gates.

I added the MIGATES class to represent multiple input gates. This helps to eliminate some repeated code.