Refactor N-dimensial array resampling and add additional functionality

@JDWarner @ankit-maverick This serves as an improvement for the functionality started in #511.