Architecture changes. Tests implemented.