update karma dependency to 0.10
remove stray curly brace from the 'delegate' function, sort out the untidy indentation, properly declare a couple of function-scope variables