Added filter capabilities to batch. Some debugging code added (the phantom script can now take a --verbose flag). Flag parsing improved.