Simulator made better with code cleanup and added appropriate callbacks on digitalwrite and analogwrite.