Decided to not go with a 100% shell implementation for server side on selling the ebook. For logging purchases to the database I've decided to go with C++ so I don't need to figure out how to avoid shell quoting problems while preventing injection attacks. That program, of course, is still called from a shell script.
CGI in bash: Let's be real, you don't need to scale.