Use a real modulo calculation for repeated tilemaps. Fixes #10