Moved all headers into one file. Some refactoring. Changes in tests.