Finished basis implementation and tests.