Cleanup and updating of bash and r-scripts before the merge to develop.