WIP: of_type impl

closes #7316
this utility is actually pretty generic (if you pass in the axis) and can be used in lots of places (though I would actually write this generically and not as a part of NDFrame, put in core/common.py). maybe do this in separate PR as need to replace this in many places. (mosting in core/indexing.py)