Need serious help with notation representing matrices as "scalars" 
Here, $\hat{S_{j}}$ are Spin-1/2 system spin matrices. For those who don't know, it's just a 2x2 matrix. 
I am not familiar with representing matrices as "scalars" when doing multiplying with $e_{j}$, as in the first line. I never learned it in my linear algebra class, or my mathematical physics class, actually there's quite a few important stuff (change of basis etc.) that my "professor"(grad student) chose not to teach. 
Anyway, I've asked around and the first line in the picture, can be thought of as  a 3x1 column (or row) vector with each element being $\hat{S_{j}}$, which we treat as "scalars". Sort of like matrix within matrix. Is this correct? If so, how do you end up with just one 2x2 matrix as a result in the bottom line? 
 A: If
$$\hat S_1=\frac{\hbar}{2}\pmatrix{0&1\\1&0}$$
is a spin matrix, i.e. a rank-$2$ tensor, and
$$\vec e_1=\pmatrix{1\\0\\0}$$
is the unit vector pointing in the $x$ direction, i.e. a rank-$1$ tensor,
then the tensor product $\hat S_1\otimes\vec e_1$ is a rank-$3$ tensor, since $2+1=3$. It may be abbreviated $\hat S_1\vec e_1$ and, yes, it may be written out as
$$\hat S_1\vec e_1 = \frac{\hbar}{2}\pmatrix{0&1\\1&0}\otimes\pmatrix{1\\0\\0} = \frac{\hbar}{2} \pmatrix{\pmatrix{0&1\\1&0}\\\pmatrix{0&0\\0&0}\\\pmatrix{0&0\\0&0}}.$$
It would be better to draw the tensor as a $2\times2\times3$ solid box of numbers, but that's hard to do on a chalkboard, so a matrix of matrices is the next best thing. If you search around the Internet, you can probably find better visualizations of rank-$3$ tensors.
Similarly, we have
$$\hat{\vec{S}}=\hat S_1\vec e_1+\hat S_2\vec e_2+\hat S_3\vec e_3
=\frac{\hbar}{2}\pmatrix{\pmatrix{0&1\\1&0}\\\pmatrix{0&0\\0&0}\\\pmatrix{0&0\\0&0}}
+\frac{\hbar}{2}\pmatrix{\pmatrix{0&0\\0&0}\\\pmatrix{0&-i\\i&0}\\\pmatrix{0&0\\0&0}}
+\frac{\hbar}{2}\pmatrix{\pmatrix{0&0\\0&0}\\\pmatrix{0&0\\0&0}\\\pmatrix{1&0\\0&-1}}
=\frac{\hbar}{2}\pmatrix{\pmatrix{0&1\\1&0}\\\pmatrix{0&-i\\i&0}\\\pmatrix{1&0\\0&-1}}.$$
You should not interpret $\hat S_1\vec e_1$ to mean matrix multiplication, in the sense of contracting one of the indices of $\hat S_1$ with the index of $\vec e_1$ to get a rank-$1$ tensor. (More bluntly, disregard Ivo Terek's suggestion.) Thankfully, since $\hat S_1$ has only two rows and two columns, there's no way to accidentally contract it with the three rows of $e_1$. As you point out in the comments, that doesn't even make sense.
In the bottom line, the middle dot "$\cdot$" is meant to denote a dot product, which gets rid of all the spatial indices by contracting them with each other, just like an ordinary dot product of two vectors in $3$-space. Specifically, the spatial index of $\hat{\vec{S}}$ is being contracted with the spatial index of $\vec e_r$. In symbols, $$\hat{\vec{S}}\cdot\vec e_r=\vec S_1\sin\theta\cos\phi+\vec S_2\sin\theta\sin\phi+\vec S_3\cos\theta.$$
This is a sum of three $2\times2$ spin matrices, which is again a $2\times2$ spin matrix.
