Implemented spells and begun tidying up code