Add tests for store controller and link controller.
Merge back changes from cleanup branch.