Restructured primitives->contracted->basisfuntions, and cleaned up class system significantly.