beginning unit test. fixed various parsing bugs.
added linear functionals. closes #2