Starspot mapping with adaptive parallel tempering. I. Implementation of computational code