added id() for algorithms, code cleanup
moved implementation to cpp, register_algorithm doesn't need name any more
added id() for algorithms