Added VoltageSource and Resistor classes and refactored