Code refactoring and various fixes.

Add <set> command as replacement for <autologin> and <search_options>