MEAR-146: add an option to tune the way the library-directory element is generated in the application.xml. Based on patch provided by Alex Halovanic. Also fixes MEAR-151.