Eliminate many instances of reflection via type hints

Please check them over with some care before accepting them, in case I messed any of them up.