so many changes

url rewrite with JS, you can now edit pages and add directories. some
code fixes.