added elasticsearch to travis-ci config and refactored populate/cleanup code