multitude of fixes including

1. new way of computing app pointer table (sergio fix)
2. region ids in c and python code mapped