Add gpio.cleanup() and remove gpio.setwarnings(False)

I have included comments in the code as to why these changes were made.