Base code for #1 and #2 added. Automatically update post/page links by hooking to the respective filters. Added propper support for custom slugs for hierarchical post types. Various small fixes.