Pathfinder rewrite - minetest PR #1151 squashed

Remove lots of annoying code and comments.

Write algorithm + some optimization.

Add some files.

Fix some bugs. Remove debug info.