Rewrite register profile parser to make it cleaner and more robust

- Make all the reg profiles heap-allocated for consistency
- Fail gracefully when the profile has errors
- Minor fixups