Cleaned up application, added authentication support.