remove optional dependencies

Fulfills #1005
Derived from #1067 

This code was paraphrased from #1067 just FYI
Thanks @nemanjawork

Review @mikeal @nylen @FredKSchott @emkay