Add a variable to replace hard-coded upper bound

Haven't tested this since I don't have a large set of data.
Merge branch 'master' of github.com:hexmode/SemanticMediaWiki