merged github head into our branch
merged javadoc, added javadoc for replace function