Added metropolis optimizer tests and demo