Implement automatic package detection

This allows simpler compiling using not qualified class names.