[SPARK-4431][MLlib] Implement efficient activeIterator for dense and sparse vector

Previously, we were using Breeze's activeIterator to access the non-zero elements 
in sparse vector, and explicitly skipping the zero in dense/sparse vector using 
pattern matching. Due to the overhead, we switched back to native `while loop` 
in #SPARK-4129.

However, #SPARK-4129 requires de-reference the dv.values/sv.values in 
each access to the value, and the zeros in dense vector and sparse vector 
if exist are skipped in the add function call; the overall penalty will be 
around 10% compared with de-reference once outside the while block, 
and checking if zero before calling the add function. The code is branched out 
for dense and sparse vector, and it's not easy to maintain in the long term.

Not only this activeIterator implementation increases the performance, 
but the abstraction of accessing the non-zero elements in different 
vector type also helps the maintainability of codebase. In this PR, 
only MultivariateOnlineSummarizer uses new API as example, 
and others can be migrated to activeIterator later.

Benchmarking with mnist8m dataset on single JVM 
with first 200 samples loaded in memory, and repeating 5000 times.

Before change: 
Sparse Vector - 30.02
Dense Vector - 38.27

With this optimization and no local copy:
Sparse Vector - 27.54
Dense Vector - 35.13

(PS, when I did the bytecode analysis, I found that accessing the 
member variables of values and values.size require two operation. 
By having a local copy of reference to make it as single call, there is
another 8% performance gain. See 
http://stackoverflow.com/questions/6602922/is-it-faster-to-access-final-local-variables-than-class-variables-in-java for detail)

With this optimization and local copy:
Sparse Vector - 26.37
Dense Vector - 32.43


You are right; the `Tuple2[Int, Double]` is specialized, and I mistakenly interpreted the bytecode. 
For the flowing scala code,
```scala
def foreach[@specialized(Unit) U](f: ((Int, Double)) => U) {
  var i = 0
  val localValuesSize = values.size
  val localValues = values
  while (i < localValuesSize) {
    f(i, localValues(i))
    i += 1
  }
}
```
the generated bytecode will be
```
  public foreach(Lscala/Function1;)V
   L0
    LINENUMBER 296 L0
    ICONST_0
    ISTORE 2
   L1
    LINENUMBER 297 L1
    GETSTATIC scala/Predef$.MODULE$ : Lscala/Predef$;
    ALOAD 0
    INVOKEVIRTUAL org/apache/spark/mllib/linalg/DenseVector.values ()[D
    INVOKEVIRTUAL scala/Predef$.doubleArrayOps ([D)Lscala/collection/mutable/ArrayOps;
    INVOKEINTERFACE scala/collection/mutable/ArrayOps.size ()I
    ISTORE 3
   L2
    LINENUMBER 298 L2
    ALOAD 0
    INVOKEVIRTUAL org/apache/spark/mllib/linalg/DenseVector.values ()[D
    ASTORE 4
   L3
    LINENUMBER 299 L3
   FRAME APPEND [I I [D]
    ILOAD 2
    ILOAD 3
    IF_ICMPGE L4
   L5
    LINENUMBER 300 L5
    ALOAD 1
    NEW scala/Tuple2$mcID$sp
    DUP
    ILOAD 2
    ALOAD 4
    ILOAD 2
    DALOAD
    INVOKESPECIAL scala/Tuple2$mcID$sp.<init> (ID)V
    INVOKEINTERFACE scala/Function1.apply (Ljava/lang/Object;)Ljava/lang/Object;
    POP
   L6
    LINENUMBER 301 L6
    ILOAD 2
    ICONST_1
    IADD
    ISTORE 2
    GOTO L3
```

However, 
```
    INVOKESPECIAL scala/Tuple2$mcID$sp.<init> (ID)V
    INVOKEINTERFACE scala/Function1.apply (Ljava/lang/Object;)Ljava/lang/Object;
```
is expensive, so that's why checking zero in the anonymous function will slow down the whole thing. 

I agree with you, the iterator is slow by nature, and we are only interested in foreach implementation. I'll remove the iterator, and just have foreach method in vector.