Directory Service code, Add some tests
not completely broken any more. Fixing startup script and washing the code