Fixed scopes in loops, added single dimensional array initialization

Changed controller so that controller handles the console out during
tests. This way we don't have to have an if statement to check if
controller is null or not.
Controller outputs to System.out if console is null.