refactored clusters and added tests for clusters namespace.
Fixed a couple of failing unit tests and some minor changes (mostly typos).