Optimize copyN for compatible pointer types
Fix white space
Add generic filtering function

- Added a generic filtering function that can be used to implement both
  linear and non-linear filtering schemes.
- Implemented linear filtering and median filtering on top of it.
Add PiiTimeLimiter