PKGBUILD rewrite (according to pacman 4); todo items moved to main.c