A new take on type providers (cleaned up)

rebased, cleanup version of #530 
review by @szeiger