apps directory

@nitishsrivastava,

I propose separate directory for applications/tools/tests. I also thought about additional directory only for tests, but I didn't create it, because we don't have much tests now.
Second commit fixed several minor issues.