complete d3d device creation and destruction

The d3d device is maintained with context for proper dll management.
Context creation is via FactoryBase, and the actual call to
D3D10CreateDevice1 can be easily overridden.