Introduce a get_max_memory function

This helps in specifying the maximum memory way more easily.
We do not need to specify the memory in kB any more.
remove the bash functions from environment
update the README with information about max_memory