split into class files, FINALLY ADDED AUTOLOADING, improved URL var check