php-driven javascript library generation