More structure

Rather big pull request.

What I've done is basically to introduce Smarty, which is a great template engine for PHP. It makes it possible to seperate HTML and PHP-logic. It is a lot more "clean" to do it this way, rather than mixing the two in files.

Instead ot adding Smarty as a library in the pull, I use Composer to install it. Instructions in README.md.

I also develop at a server where the webserver it not at / but in a sub directory. Because of this (and because it is a lot more dynamic), I removed all the hardcoded paths in the front end.

Please ask or comment if you see anything.