Cleanup.

* move upper and document psnr
* export recently developed functions