Added option to export environment variables, test changes. Added JavaDoc comments.