Proper application of nodata switch for all cases in rio-shapes

Plus tests to get to 100% coverage.
@sgillies Consider moving ```nodata_mask = None``` up here so it transcends the ```if``` branching below.