added test to expose #238,  refs #238
Fixed tests, rewriting is now correct for included files fixes #238
fixed error in including custom css refs: #239