Added simple calloc implementation.

Needed for HashMap.
Don't use partition pointer as id, as it only works on 32bit platforms.

Use a counter to generate the partition id, and store the id to partition
lookup in a hashmap instead.