Various changes made in getting the tutorial example (docs/mypack) to build properly

I'm not sure where or when this problem became visible, but the tutorial docs in the current head don't build correctly due to the various problems this PR addresses.

I'm not sure whether the fixes are completely correct (I'm still getting to understand the code), but they do make visible the problem areas.

For the record, this is with Cython 0.19.