Cleaned up template definitions.

- Use std::enable_if where possible; static_assert() elsewhere.
- Prefer universal references.
- Use 'typename' instead of 'class'.
Catch: Updated to v1.0 build 52.
Moved tests to a separate translation unit.
libpng: Updated to v1.6.12.
Smart pointers as parameters correctness.