Code review feedback

Rearrange function a bit.
Hi @scottpurdy , actually `encodeIntoArray()` accept a bit array as default. The purpose of https://github.com/numenta/nupic/pull/1524 simply check if the parameter is a string, if yes, convert it to bit array, if not, just ignore it and continue processing. Are you wishing that this encoder accepts only string parameter? If yes, we have to refactor the remaining code that uses this encoder (including the tests).