Reduce amount of AJAX urls called to refresh container and host info

This is a fix from Claudyus' repository, something I was meaning to do myself anyway.

There are a few differences in the JavaScript, as I didn't quite agree with a few design choices.

This is mainly to do with making a function do just one thing, which is part of good application design, for example having refreshMemoryHost() call refreshMemoryContainers() means this function now does two things and the name of the function is a bit misleading, so I did that differently and kept the functions separated.

Also, there was a bit where it called refreshInfo, and only on a successful AJAX response did it call refreshMemoryHost... JavaScript is event based and we have multiple workers, so there is no reason why we can't do this in parallel as I did.