Split out server-specific functions into a separate file. Added previewing capability to Create and Edit post handlers.