Added StackTrace and restructured things

Also fixed a problem in Log where creating a new log file would fail.
Added MemValue and restructured things

The interface is far from finished, but all this will lead some nice
abstraction that may even allow third parties to define their own
primitives.