Create cookies dir, reorganize lib to subfolder
Add debug function for use outside of class