Implement remaining boundary conditions for linear interpolation

This also:
- compares against the correct answer
- provides a number of fixes to many of the boundary conditions
- add a BCinbounds type that avoids any bounds-checking