Elegant solution to conditionally serving javascript! :D