Add memory.cpp and memory.hpp; Update utils.hpp

Add code for the allocation of the main memory and the access to it.
Update the utils to provide exception type aliases.

Signed-off-by: chaosmasttter <fe.kunzmann@gmail.com>