Refactored the Legend and Plot.* modules for the deep embedding.

Also removed some unused ScopedTypeVariables.