The basic answer to your question is: Yes. Software can be patented.
Ultimately, only the Patent Office can make the determination as to
whether your particular software is patentable or not (and even then,
their decision can be overruled by some courts).
But in general terms, software that creates a new way of doing things
-- even if based on existing modules -- is known as a business method
patent, and is emminently patentable.
Some examples of patented software can be seen here:
List of software patents
and the Business Methods (including software) site of the US Patent Office is here:
Patent Business Methods
though be warned...everything here is deeply steeped in
government-speak, and is very hard to wade through. You might want to
start with this background paper:
Successfully Preparing and Prosecuting a Business Method Patent Application
which is as close as they get to understandable English.
For a more international perspective, have a look at this site from
the World Intellectual Property Organization:
Please keep in mind the disclaimer at the bottom of this page...Google
Answers is not a substitute for professional advice, so you may want
to speak with a patent specialist about your invention.
Let me know if there's anything more I can do for you on this.
All the best,