Optimise homepage loading
The slow loading of the home page causes LbAPLocal to fail randomly with timeouts. This PR avoids the issue by significantly optimising the SQL to avoid dumping what is effectively the entire database.
Also includes a minor bytes/str confusion in the dynamic_reproduce_locally
route that was spotted by @aiwieder.