Remove analyze code from controller and use scope broadcast to call function in directive. Close #32.