Notice that both sums break the number up into pairs of binary digits: you’re adding (or alternately adding and subtracting) the quantities $b_{2k}+2b_{2k+1}$. Look at a concrete example, say $1101001011$.
$$\begin{array}{rcc}
k:&4&3&2&1&0\\
b_{2k+1}b_{2k}:&11&01&00&10&11\\
b_{2k}+2b_{2k+1}:&3&1&0&2&3
\end{array}$$
The proposed test for divisibility by $3$ then adds the numbers in the bottom row to get $9$, which is divisible by $3$, and indeed $1101001011_{\text{two}}=843=3\cdot281$ is divisible by $3$.
In fact the bottom row is just the base four representation of $n$:
$$\sum_{k=0}^{2m}b_k2^k=\sum_{k=0}^m(b_{2k}+2b_{2k+1})2^{2k}=\sum_{k=0}^m(b_{2k}+2b_{2k+1})4^k\;,$$
and each $b_{2k}+2b_{2k+1}$ is $0,1,2$, or $3$. If you think of it in terms of the base four representation, this test is just like the usual test for divisibility by $9$ of a number written in ordinary decimal notation, and it works for the same reason: $3$ is $1$ less than the base, just as $9$ is $1$ less than our usual base of $4$.
The general result is that if you write a positive integer in base $b$, that integer is divisible by $b-1$ if and only if the sum of its digits is divisible by $b-1$ and, more generally, the integer and the sum of its digits are congruent modulo $b-1$.
To see this, let $n=\sum_{k=0}^md_kb^k$, where each $d_k\in\{0,1,\ldots,b-1\}$. Clearly $b\equiv 1\pmod{b-1}$, so $b^k\equiv 1^k\pmod{b-1}$, and of course $1^k=1$, so
$$n=\sum_{k=0}^md_kb^k\equiv\sum_{k=0}^md_k\pmod{b-1}\;.$$
The test for divisibility by $5$ is similar, except that it takes the alternating sum of the base four digits. If you know the test for divisibility by $11$ in our ordinary decimal system, you’ll recognize this as analogous, and again it works more generally: an integer written in base $b$ is congruent mod $b+1$ to the alternating sum of its digits, and in particular it’s divisible by $b+1$ if and only if the alternating sum of its digits is. Again the calculation is straightforward: we use the fact that $b\equiv-1\pmod{b+1}$, so that
$$\sum_{k=0}^md_kb^k\equiv\sum_{k=0}^md_k(-1)^k\pmod{b+1}\;.$$
In the present case $b$ is really $4$, even though we’re actually working with numbers written in binary: as noted above, using the terms $b_{2k}+2b_{2k+1}$ is in effect just converting the number to base four.
For the final part of the question you’ll want a base different from $4$, but it will still be one such that the representation in that base is very, very easily derivable from the binary representation.