add support for multiple static directories, and move some portality files up into app template