ENH: Better tests and cleaner app