Security and authentication added. Some code cleanups might happened during this commit! :-)