Added support for automatic stylesheet loading

And removed the previous regular-expression based system
Update the test cases to avoid Chrome firing XHR exception in local