Refactor ThePlayer common code

Extract pattern decoding to a separate function. This move aims to
modularize the loader to plug the pattern decoding algorithms used in
versions 4.0 and 6.1.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>