Fix bugs, refactor.

- initial work on ptr and string types
- fix link bugs
- fix newline after comment bug