Improve difference measurement for StackFactory

- Use numpy.nanmedian()
- Single iteration and more conservative 5-sigma clip.