Cleaned up how border drawing is done and starting the
cairo encapsulation code.