Added tests. Also added a 'file' option for processing single images.